/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.devmng.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.modules.sys.entity.Office;
import com.thinkgem.jeesite.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 任务Entity
 *
 * @author panda
 * @version 2017-12-04
 */
public class TaskMain extends DataEntity<TaskMain> {

    private static final long serialVersionUID = 1L;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date taskStart;        // 计划开始时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date taskEnd;        // 计划结束时间
    private User taskOperator;        // 操作人
    private String taskTitle;        // 任务标题
    private String taskType;        // 任务类型
    private Office sysOffice;        // 部门
    private String taskStatus;        // 任务状态
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startDate;        // 签收开始时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date closeDate;        // 结束时间
    private Date beginTaskStart;        // 开始 开始时间
    private Date endTaskStart;        // 结束 开始时间
    private Date beginTaskEnd;        // 开始 结束时间
    private Date endTaskEnd;        // 结束 结束时间

    private String stationDutyPerson; // 值班人员

    private String stationAttendant; // 跟班人员

    private String netDispatcher; // 网调室人员

    private BigDecimal lon; // 经度

    private BigDecimal lat; // 纬度

    private String weatherCondition; // 天气情况

    private String dutyPersonInfo; // 值班人员情况A-良好、B-不良

    private String dutyPersonRemarks; // 值班人员备注

    private String multiTaskId; //多任务ID

    public TaskMain() {
        super();
    }

    public TaskMain(String id) {
        super(id);
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "开始时间不能为空")
    public Date getTaskStart() {
        return taskStart;
    }

    public void setTaskStart(Date taskStart) {
        this.taskStart = taskStart;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "结束时间不能为空")
    public Date getTaskEnd() {
        return taskEnd;
    }

    public void setTaskEnd(Date taskEnd) {
        this.taskEnd = taskEnd;
    }

    @NotNull(message = "操作人不能为空")
    public User getTaskOperator() {
        return taskOperator;
    }

    public void setTaskOperator(User taskOperator) {
        this.taskOperator = taskOperator;
    }

    @Length(min = 1, max = 255, message = "任务标题长度必须介于 1 和 255 之间")
    public String getTaskTitle() {
        return taskTitle;
    }

    public void setTaskTitle(String taskTitle) {
        this.taskTitle = taskTitle;
    }

    @Length(min = 1, max = 10, message = "任务类型长度必须介于 1 和 10 之间")
    public String getTaskType() {
        return taskType;
    }

    public void setTaskType(String taskType) {
        this.taskType = taskType;
    }

    public Office getSysOffice() {
        return sysOffice;
    }

    public void setSysOffice(Office sysOffice) {
        this.sysOffice = sysOffice;
    }

    @Length(min = 0, max = 20, message = "任务状态长度必须介于 0 和 20 之间")
    public String getTaskStatus() {
        return taskStatus;
    }

    public void setTaskStatus(String taskStatus) {
        this.taskStatus = taskStatus;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getCloseDate() {
        return closeDate;
    }

    public void setCloseDate(Date closeDate) {
        this.closeDate = closeDate;
    }

    public Date getBeginTaskStart() {
        return beginTaskStart;
    }

    public void setBeginTaskStart(Date beginTaskStart) {
        this.beginTaskStart = beginTaskStart;
    }

    public Date getEndTaskStart() {
        return endTaskStart;
    }

    public void setEndTaskStart(Date endTaskStart) {
        this.endTaskStart = endTaskStart;
    }

    public Date getBeginTaskEnd() {
        return beginTaskEnd;
    }

    public void setBeginTaskEnd(Date beginTaskEnd) {
        this.beginTaskEnd = beginTaskEnd;
    }

    public Date getEndTaskEnd() {
        return endTaskEnd;
    }

    public void setEndTaskEnd(Date endTaskEnd) {
        this.endTaskEnd = endTaskEnd;
    }

    public String getStationDutyPerson() {
        return stationDutyPerson;
    }

    public void setStationDutyPerson(String stationDutyPerson) {
        this.stationDutyPerson = stationDutyPerson;
    }

    public String getStationAttendant() {
        return stationAttendant;
    }

    public void setStationAttendant(String stationAttendant) {
        this.stationAttendant = stationAttendant;
    }

    public String getNetDispatcher() {
        return netDispatcher;
    }

    public void setNetDispatcher(String netDispatcher) {
        this.netDispatcher = netDispatcher;
    }

    public BigDecimal getLon() {
        return lon;
    }

    public void setLon(BigDecimal lon) {
        this.lon = lon;
    }

    public BigDecimal getLat() {
        return lat;
    }

    public void setLat(BigDecimal lat) {
        this.lat = lat;
    }

    public String getWeatherCondition() {
        return weatherCondition;
    }

    public void setWeatherCondition(String weatherCondition) {
        this.weatherCondition = weatherCondition;
    }

    public String getDutyPersonInfo() {
        return dutyPersonInfo;
    }

    public void setDutyPersonInfo(String dutyPersonInfo) {
        this.dutyPersonInfo = dutyPersonInfo;
    }

    public String getDutyPersonRemarks() {
        return dutyPersonRemarks;
    }

    public void setDutyPersonRemarks(String dutyPersonRemarks) {
        this.dutyPersonRemarks = dutyPersonRemarks;
    }


    public String getMultiTaskId() {
        return multiTaskId;
    }

    public void setMultiTaskId(String multiTaskId) {
        this.multiTaskId = multiTaskId;
    }

    public enum Status {
        OPEN,
        PROCESSING,
        CLOSE,
        DELAY_COPY, // 延误
        PENDING; // 待审
    }

    public enum WeatherCondition {
        SUNNY, // 晴天
        OVERCAST, // 阴天
        RAIN; // 雨天
    }

    public enum DutyPersonInfo {
        A, // 良好
        B; // 不良
    }
}